package com.xtq.springcloud.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: xietianqi
 * @create: 2024-01-25 15:19
 * @description: 配置自己的负载均衡算法
 **/
@Configuration
public class RibbonRule {
	@Bean
	public IRule myRibbonRule(){
		// 随机负载均衡算法
		return new RandomRule();
	}
}
